import pymongo

def data_query():
    py_client = pymongo.MongoClient(
        host="10.10.61.31",
        username="opsmart",
        password="q1w2e3r4",
        authSource='miaozhen',
        authMechanism='SCRAM-SHA-1'
    )
    db = py_client.miaozhen
    print "start"
    db.SFLZ_StdMedicine.update({}, {'$rename' : {"ypid" : "medicine_id"}}, False, False, True)
    print "end"

def main():
    data_query()

main()